home *** CD-ROM | disk | FTP | other *** search
/ PC Open 93 / PC Open 93 CD 2.bin / PDF / webdeveloper / lezione_2 / Listato 14.txt < prev    next >
Encoding:
Text File  |  2003-10-31  |  916 b   |  39 lines

  1. LISTATO 14 - ANNOETARISPOSTA2.ASP
  2.  
  3.  
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5.  
  6. <html>
  7. <head>
  8.     <title>Pagina che richiede nome e anno di nascita</title>
  9. </head>
  10.  
  11. <body>
  12.  
  13. <%
  14.     Dim anno
  15.     Dim eta
  16.     
  17.     on error resume next
  18.     
  19.     anno = cint(request.QueryString("anno"))
  20.     
  21.     if Err then
  22.         response.write "Gentile utente, si Φ verificato un errore nella compilazione dei tuoi dati <br>"
  23.         response.write "Descrizione dell'errore: " & Err.Description & "<br>"
  24.         response.write "Codice dell'errore: " & Err.Number & "<br>"
  25.         If Err.Number = 13 Then
  26.             response.write "Devi inserire un numero come anno di nascita<br>"
  27.         End If
  28.         response.write "Torna alla <a href=""annoeta2.asp"">pagina precedente</a>"
  29.         response.end
  30.     end if
  31.     eta = Year(Now()) - anno
  32. %>
  33.  
  34. Ciao <%=request.QueryString("nome")%>, hai <%=eta%> anni.
  35.  
  36. </body>
  37. </html>
  38.  
  39.